<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        function dateFormate(date, format = "yyyy-MM-dd HH:mm:ss") {
            const config = {
                yyyy: date.getFullYear(),
                MM: date.getMonth() + 1,
                dd: date.getDate(),
                HH: date.getHours(),
                mm: date.getMinutes(),
                ss: date.getSeconds()
            }
            for (const key in config) {
                format = format.replace(key, config[key]);
            }
            return format;
        }


        const date = new Date("1999-02-28 5:33:55");
        // console.log(date.getFullYear());
        // console.log(date.getMonth());
        // console.log(date.getDate());
        // console.log(date.getHours());
        // console.log(date.getMinutes());
        // console.log(date.getSeconds());

        console.log(dateFormate(date, "yyyy年MM月dd日"));
    </script>
</body>

</html>